package pers.exercise.CompositePattern;

import pers.exercise.CompositePattern.impl.CommentNode;
import pers.exercise.CompositePattern.impl.ElementNode;
import pers.exercise.CompositePattern.impl.TextNode;

public class Entry {
    public static void main(String args[]){

        Node root = new ElementNode("school");
        root.add(new ElementNode("classA")
        .add(new TextNode("Tom"))
        .add(new TextNode("Alice")));
        
        root.add(new ElementNode("classB")
        .add(new TextNode("Bob"))
        .add(new TextNode("Grace"))
        .add(new CommentNode("comment...")));

        System.out.println(root.toXml());
    }   
}
